package com.yixing.tech.common.convert;

import java.util.Optional;

public class IntegerToStringConverter implements Converter<Integer, String> {

    @Override
    public String convert(Integer source) {
        return Optional.ofNullable(source).map(x -> x + "").orElse(null);
    }

    @Override
    public Class<Integer> getSourceType() {
        return Integer.class;
    }

    @Override
    public Class<String> getTargetType() {
        return String.class;
    }

}
